using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.Build.Framework;

namespace cosoware.MSBuildTasks.Subversion
{
    /// <summary>
    /// Get wotking copy from repository.
    /// </summary>
    public class SvnCheckout : SvnTask
    {
        /// <summary>
        /// Repository URL.
        /// </summary>
        ITaskItem _url;

        /// <summary>
        /// Working copy destination.
        /// </summary>
        ITaskItem _destination;

        /// <summary>
        /// Gets the info command.
        /// </summary>
        /// <value>The command.</value>
        protected override string Command
        {
            get { return "checkout"; }
        }

        /// <summary>
        /// Gets or sets the url checkout for.
        /// </summary>
        /// <value>The url checkout for.</value>
        /// <summary>
        [Required]
        public ITaskItem Url
        {
            get { return GetInputTaskItem("Url"); }
            set { InitializeInputTaskItem("Url", value); }
        }


        /// <summary>
        /// Gets or sets the url checkout for.
        /// </summary>
        /// <value>The target.</value>
        [Required]
        public ITaskItem Destination
        {
            get { return _destination; }
            set { _destination = value; }
        }

        /// <summary>
        /// Builds the parameters command line.
        /// </summary>
        protected override void BuildCommandLine()
        {
            AppendSwitch(Url);
            AppendSwitch(Destination);
        }
    }
}
